Finite Automata
Basic definition:
- An alphabet is a non-empty, finite, set of symbols.
- A string w over an alphabet is a finite (0 or more) sequence of symbols from , an empty string denote by
- The set of all strings is denoted
- A language is any subset of
Deterministic finite automaton (DFA): input output
- Same state and same read character same next state (Deterministic)
- Finite number of states (finite)
- no empty string && each character only appear once && arrow for each charter in
Steps:
- Predefined start state
- reads input (per char at a time). Depend on the character read and current state, deterministically moves to a new state
- Finish reading, check if accept states. If accept, then accept. Otherwise rejects. (double circle accept)
Let be a DFA, the language of a DFA denoted is the set of strings such that accepts .
The template of defining a DFA:
- Fix the alphabet, of the DFA
- Define a finite set of states
- A start state
- Define a subset are accept states
- , define ,
Nondeterministic finite automaton(NFA):
-
Allow empty string , character can appear more times or 0 times
-
Same state and same read character same next state (Deterministic)
-
Finite number of states (finite)
Steps:
- Predefined start state
- reads input (per char at a time). Depend on the character read and current state, deterministically moves to a new state
- no such input appear in some arrow, immediately reject
- Since same character can appear many times, we need to make choice. That's, NFA accepts the string if any sequence of choices leads to an accept state
Let be a NFA, the language of a NFA denoted is the set of strings such that accepts .
Let be any language over .
- There is a DFA such that is a NFA such that is regular
- is regular if there is a DFA such that .
- The complement of denote
- The concatenation of and denote is the set of strings that your get by concatenating a string in and a string in
- , define . Let .
- , called Kleene star, or "A star"
Let be any language over . , is distinguisher for
Define a binary equivalence relationship relative to language A over as , a distinguisher for . In this situation, we say is indistinguishable from relative to .
Myhjill-Nerode Theorem: Let be language over . is regular has a finite number of equivalence classes.
- To prove not regular, we can find an infinite set s.t. any two elements are distinguishable. In other words, Let be a language. A set is infinite is not regular
Define .